3.47 \(\int \frac{\tan ^4(c+d x)}{a+i a \tan (c+d x)} \, dx\)

Optimal. Leaf size=90 \[ -\frac{\tan ^3(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac{i \tan ^2(c+d x)}{a d}+\frac{3 \tan (c+d x)}{2 a d}-\frac{2 i \log (\cos (c+d x))}{a d}-\frac{3 x}{2 a} \]

[Out]

(-3*x)/(2*a) - ((2*I)*Log[Cos[c + d*x]])/(a*d) + (3*Tan[c + d*x])/(2*a*d) - (I*Tan[c + d*x]^2)/(a*d) - Tan[c +
 d*x]^3/(2*d*(a + I*a*Tan[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0942289, antiderivative size = 90, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3550, 3528, 3525, 3475} \[ -\frac{\tan ^3(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac{i \tan ^2(c+d x)}{a d}+\frac{3 \tan (c+d x)}{2 a d}-\frac{2 i \log (\cos (c+d x))}{a d}-\frac{3 x}{2 a} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^4/(a + I*a*Tan[c + d*x]),x]

[Out]

(-3*x)/(2*a) - ((2*I)*Log[Cos[c + d*x]])/(a*d) + (3*Tan[c + d*x])/(2*a*d) - (I*Tan[c + d*x]^2)/(a*d) - Tan[c +
 d*x]^3/(2*d*(a + I*a*Tan[c + d*x]))

Rule 3550

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((b
*c - a*d)*(c + d*Tan[e + f*x])^(n - 1))/(2*a*f*(a + b*Tan[e + f*x])), x] + Dist[1/(2*a^2), Int[(c + d*Tan[e +
f*x])^(n - 2)*Simp[a*c^2 + a*d^2*(n - 1) - b*c*d*n - d*(a*c*(n - 2) + b*d*n)*Tan[e + f*x], x], x], x] /; FreeQ
[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[n, 1]

Rule 3528

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(d
*(a + b*Tan[e + f*x])^m)/(f*m), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{\tan ^4(c+d x)}{a+i a \tan (c+d x)} \, dx &=-\frac{\tan ^3(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac{\int \tan ^2(c+d x) (3 a-4 i a \tan (c+d x)) \, dx}{2 a^2}\\ &=-\frac{i \tan ^2(c+d x)}{a d}-\frac{\tan ^3(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac{\int \tan (c+d x) (4 i a+3 a \tan (c+d x)) \, dx}{2 a^2}\\ &=-\frac{3 x}{2 a}+\frac{3 \tan (c+d x)}{2 a d}-\frac{i \tan ^2(c+d x)}{a d}-\frac{\tan ^3(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac{(2 i) \int \tan (c+d x) \, dx}{a}\\ &=-\frac{3 x}{2 a}-\frac{2 i \log (\cos (c+d x))}{a d}+\frac{3 \tan (c+d x)}{2 a d}-\frac{i \tan ^2(c+d x)}{a d}-\frac{\tan ^3(c+d x)}{2 d (a+i a \tan (c+d x))}\\ \end{align*}

Mathematica [B]  time = 1.71953, size = 196, normalized size = 2.18 \[ \frac{\cos (c) \sec (c+d x) (\cos (d x)+i \sin (d x)) \left (-8 d x \tan ^2(c)+(-8-8 i \tan (c)) \tan ^{-1}(\tan (d x))+2 i d x \tan (c)+8 d x \sec ^2(c)-2 i \sec ^2(c+d x)-i \tan (c) \sin (2 d x)-4 i \log \left (\cos ^2(c+d x)\right )+(\tan (c)+i) \cos (2 d x)+2 \tan (c) \sec ^2(c+d x)+4 \sec (c) \sin (d x) \sec (c+d x)+4 \tan (c) \log \left (\cos ^2(c+d x)\right )+4 i \tan (c) \sec (c) \sin (d x) \sec (c+d x)-6 d x+\sin (2 d x)\right )}{4 d (a+i a \tan (c+d x))} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^4/(a + I*a*Tan[c + d*x]),x]

[Out]

(Cos[c]*Sec[c + d*x]*(Cos[d*x] + I*Sin[d*x])*(-6*d*x - (4*I)*Log[Cos[c + d*x]^2] + 8*d*x*Sec[c]^2 - (2*I)*Sec[
c + d*x]^2 + 4*Sec[c]*Sec[c + d*x]*Sin[d*x] + Sin[2*d*x] + ArcTan[Tan[d*x]]*(-8 - (8*I)*Tan[c]) + (2*I)*d*x*Ta
n[c] + 4*Log[Cos[c + d*x]^2]*Tan[c] + 2*Sec[c + d*x]^2*Tan[c] + (4*I)*Sec[c]*Sec[c + d*x]*Sin[d*x]*Tan[c] - I*
Sin[2*d*x]*Tan[c] - 8*d*x*Tan[c]^2 + Cos[2*d*x]*(I + Tan[c])))/(4*d*(a + I*a*Tan[c + d*x]))

________________________________________________________________________________________

Maple [A]  time = 0.022, size = 89, normalized size = 1. \begin{align*}{\frac{\tan \left ( dx+c \right ) }{ad}}-{\frac{{\frac{i}{2}} \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{ad}}+{\frac{{\frac{7\,i}{4}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{ad}}+{\frac{1}{2\,ad \left ( \tan \left ( dx+c \right ) -i \right ) }}+{\frac{{\frac{i}{4}}\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{ad}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^4/(a+I*a*tan(d*x+c)),x)

[Out]

tan(d*x+c)/a/d-1/2*I/d/a*tan(d*x+c)^2+7/4*I/d/a*ln(tan(d*x+c)-I)+1/2/a/d/(tan(d*x+c)-I)+1/4*I/d/a*ln(tan(d*x+c
)+I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^4/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 2.32047, size = 409, normalized size = 4.54 \begin{align*} -\frac{14 \, d x e^{\left (6 i \, d x + 6 i \, c\right )} +{\left (28 \, d x - i\right )} e^{\left (4 i \, d x + 4 i \, c\right )} +{\left (14 \, d x - 10 i\right )} e^{\left (2 i \, d x + 2 i \, c\right )} -{\left (-8 i \, e^{\left (6 i \, d x + 6 i \, c\right )} - 16 i \, e^{\left (4 i \, d x + 4 i \, c\right )} - 8 i \, e^{\left (2 i \, d x + 2 i \, c\right )}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - i}{4 \,{\left (a d e^{\left (6 i \, d x + 6 i \, c\right )} + 2 \, a d e^{\left (4 i \, d x + 4 i \, c\right )} + a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^4/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

-1/4*(14*d*x*e^(6*I*d*x + 6*I*c) + (28*d*x - I)*e^(4*I*d*x + 4*I*c) + (14*d*x - 10*I)*e^(2*I*d*x + 2*I*c) - (-
8*I*e^(6*I*d*x + 6*I*c) - 16*I*e^(4*I*d*x + 4*I*c) - 8*I*e^(2*I*d*x + 2*I*c))*log(e^(2*I*d*x + 2*I*c) + 1) - I
)/(a*d*e^(6*I*d*x + 6*I*c) + 2*a*d*e^(4*I*d*x + 4*I*c) + a*d*e^(2*I*d*x + 2*I*c))

________________________________________________________________________________________

Sympy [A]  time = 1.99891, size = 117, normalized size = 1.3 \begin{align*} - \frac{\left (\begin{cases} 7 x e^{2 i c} - \frac{i e^{- 2 i d x}}{2 d} & \text{for}\: d \neq 0 \\x \left (7 e^{2 i c} - 1\right ) & \text{otherwise} \end{cases}\right ) e^{- 2 i c}}{2 a} - \frac{2 i \log{\left (e^{2 i d x} + e^{- 2 i c} \right )}}{a d} + \frac{2 i e^{- 4 i c}}{a d \left (e^{4 i d x} + 2 e^{- 2 i c} e^{2 i d x} + e^{- 4 i c}\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**4/(a+I*a*tan(d*x+c)),x)

[Out]

-Piecewise((7*x*exp(2*I*c) - I*exp(-2*I*d*x)/(2*d), Ne(d, 0)), (x*(7*exp(2*I*c) - 1), True))*exp(-2*I*c)/(2*a)
 - 2*I*log(exp(2*I*d*x) + exp(-2*I*c))/(a*d) + 2*I*exp(-4*I*c)/(a*d*(exp(4*I*d*x) + 2*exp(-2*I*c)*exp(2*I*d*x)
 + exp(-4*I*c)))

________________________________________________________________________________________

Giac [A]  time = 2.32367, size = 117, normalized size = 1.3 \begin{align*} -\frac{-\frac{7 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a} - \frac{i \, \log \left (-i \, \tan \left (d x + c\right ) + 1\right )}{a} + \frac{2 \,{\left (i \, a \tan \left (d x + c\right )^{2} - 2 \, a \tan \left (d x + c\right )\right )}}{a^{2}} - \frac{-7 i \, \tan \left (d x + c\right ) - 5}{a{\left (\tan \left (d x + c\right ) - i\right )}}}{4 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^4/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/4*(-7*I*log(tan(d*x + c) - I)/a - I*log(-I*tan(d*x + c) + 1)/a + 2*(I*a*tan(d*x + c)^2 - 2*a*tan(d*x + c))/
a^2 - (-7*I*tan(d*x + c) - 5)/(a*(tan(d*x + c) - I)))/d